{template "common/header"}
{if $op == 'setting'}
<div>
	<div class="tabbable" id="tabs" >
		<ul class="nav nav-tabs" style="border-radius: 4px;background-color: #D9EDF7;margin-bottom: 0">
			<li {if $type == 'city'}class="active"{/if}>
				 <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'city'))}" >城市设置</a>
			</li>
			<li {if $type == 'subject'}class="active"{/if}>
				 <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'subject'))}" >学科设置</a>
			</li>
			<li {if $type == 'class'}class="active"{/if}>
				 <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'class'))}" >年级设置</a>
			</li>
			<li {if $type == 'classtype'}class="active"{/if}>
				<a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'classtype'))}" >班型设置</a>
			</li>
			<li {if $type == 'semester'}class="active"{/if}>
				 <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'semester'))}" >学期设置</a>
			</li>
			<li {if $type == 'voidtype'}class="active"{/if}>
				 <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'voidtype'))}" >课程类型设置</a>
			</li>
			<!--<li {if $type == 'level'}class="active"{/if}>
				 <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'level'))}" >等级设置</a>
			</li>
			<li {if $type == 'sharetitle'}class="active"{/if}>
				 <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'sharetitle'))}" >分享标题设置</a>
			</li>-->
		</ul>
{if $type == 'city'}
	<div style="border:1px solid #cecece;border-top: 0">
			{if $oop != 'info'}
		<a href="{php echo $this->createWebUrl('index',['op'=>'qnupload'])}"  class="btn btn-success" data-toggle="modal"  style="float:right;margin: 15px;display: none;"><span>一键上传</span></a>
		<a href="#addcity"  class="btn btn-success" data-toggle="modal"  style="float:right;margin: 15px"><span onclick="clear11()">添加城市</span></a>
			<table class="table table-bordered table-hover" style="width:98%" align="center">
	            <thead>
	              <tr>
					  <th>
						  {if $paixu == 2}
						  <a href="{php echo $this->createWebUrl('index',['op'=>'setting','type'=>'city','oop'=>'list','paixu'=>1])}">
							  排序 <img src="{php echo MODULE_URL.'images/up.png'}" alt="" style="height: 14px;">
						  </a>
						  {elseif $paixu == 1}
						  <a href="{php echo $this->createWebUrl('index',['op'=>'setting','type'=>'city','oop'=>'list','paixu'=>2])}">
							  排序 <img src="{php echo MODULE_URL.'images/down.png'}" alt="" style="height: 14px;">
						  </a>
						  {/if}
					  </th>
	                <th>城市名称</th>
	                <th>城市ID</th>
	                <th>状态</th>
	                <th>操作</th>
	              </tr>
	            </thead>
	            <tbody>
	              {loop $citylist $row}
	              <tr>
					<td id="{$row['id']}" class="paixu">{$row['order']}</td>
	                <td>{$row['name']}</td>
	                <td>{$row['id']}</td>
	                <td style="width:15%">
						<div class="btn {if $row['status'] == 0}btn-danger{else}btn-info{/if}" data="{$row['id']}" onclick="citystatus(this)">{if $row['status'] == 0}不显示{elseif $row['status'] == 1}显示{/if}</div>
					</td>
	                <td>
						<a href="#addcity " data-toggle="modal" onclick="edit({$row['id']})" class="btn btn-primary">编辑</a>
						<a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'city','oop'=>'delete','cityid'=>$row['id']))}" class="btn btn-danger">删除</a>
						<a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'city','oop'=>'info','cityid'=>$row['id']))}" class="btn btn-primary">添加报名信息</a>
	                </td>
	              </tr>
	              {/loop}
	            </tbody>
	          </table>
	          <script type="text/javascript">
	          	function citystatus(obj){
	          		var obj = $(obj);
	          		var id = obj.attr('data');
	          		if(obj.hasClass('btn-danger')){
	          			var sta = 1;
	          		}else{
	          			var sta = 0;
	          		}
	          		$.ajax({
	          			type:'post',
	          			url:"{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'city','oop'=>'changestatus'))}",
	          			data:{id:id,sta:sta},
	          			success:function(res){
	          				var res = JSON.parse(res);
	          				if(res.success == 1){
	          					if(sta == 1){
	          						obj.removeClass('btn-danger');
	          						obj.addClass('btn-info');
	          						obj.html('显示');
	          					}else{
	          						obj.removeClass('btn-info');
	          						obj.addClass('btn-danger');
	          						obj.html('不显示');
	          					}
	          				}else{
	          					alert(res.mess);
	          				}
	          			}
	          		});
	          	}
				$(function(){
					$('.paixu').click(function(){
						if(!$(this).is('.input')){
							$(this).addClass('input').html('<input type="text" id="'+ $(this).attr("id") +'" style="width: 50px;" value="'+ $(this).text() +'" />').find('input').focus().blur(function(){
								var order=$(this).val();
								var id=$(this).attr("id");
								$.ajax({
									type: 'POST',
									url: "{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'city','oop'=>'sort'))}",
									data: {cityid:id,order:order},
									success:function(res){
										var res = JSON.parse(res);
										location.reload();
									}
								});
								$(this).parent().removeClass('input').html($(this).val() || 0);
							});
						}
					}).hover(function(){
						$(this).addClass('hover');
					},function(){
						$(this).removeClass('hover');
					});


				});

	          </script>

	          <div class="modal fade" id="addcity" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<form action="./index.php" method="post">
							<input type="hidden" name="c" value="site">
		  					<input type="hidden" name="a" value="entry">
		  					<input type="hidden" name="m" value="goouc_class">
		  					<input type="hidden" name="do" value="index">
		  					<input type="hidden" name="op" value="setting">
		  					<input type="hidden" name="type" value="city">
		  					<input type="hidden" name="oop" value="add">
		  					<input type="hidden" name="cityid" id="cid" value="">
						<div class="modal-content">
							<div class="modal-header">
								 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
								<h4 class="modal-title" id="city">
									添加城市
								</h4>
							</div>
							<div class="modal-body">
								<div class="form-group">
									<label  class="col-sm-2 control-label">名称</label>
									<div class="col-sm-10">
										<input type="text" name="name" id="cityname" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group">
									<label  class="col-sm-2 control-label">排序</label>
									<div class="col-sm-10">
										<input type="number" name="order" id="cityorder" value="0"  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group ">
			                        <label  class="col-sm-2 control-label">城市状态</label>
			                        <div class=" col-sm-10" style="padding-left:25px">
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status0" value="0" title="不显示"> 不显示
			                          </label>
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status1" value="1" title="显示" > 显示
			                          </label>
										<span class="help-block">若不选择，默认为不显示</span>
									</div>
			                	</div>
							</div>
							<input type="hidden" name="token" value="{$_W['token']}">
							<div class="modal-footer">
								 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								 <input type="submit" name="submit" value="保存" class="btn btn-info">
							</div>
						</div>
						</form>
					</div>
				</div>
				<script type="text/javascript">
					function clear11(){
						$('#cityname')[0].value = '';
						$('#cityorder')[0].value = 0;
						$('#status0')[0].checked = true;
						$('#status1')[0].checked = false;
                        $('#city').html('添加城市');
					}
					function edit(cityid){
						var cityid = cityid;
						var cityname = $('#cityname');
						var cityorder = $('#cityorder');
						var status0 = $('#status0');
						var status1 = $('#status1');
						var cid = $('#cid');
						status0.prop('checked','false');
						status1.prop('checked','false');
						$.get(
							'./index.php?c=site&a=entry&m=goouc_class&do=index&op=setting&type=city&oop=add',
							{cityid:cityid},
							function(res){
								cityname.val(res.name);
								cityorder.val(res.order);
								cityorder.val(res.order);
								cid.val(res.id);
								$('#city').html('修改城市信息');
								if(res.status == 0){
									status0.prop('checked','true');
								}
								if(res.status == 1){
									status1.prop('checked','true');
								}
							},"JSON"
							);
					}
				</script>
				{elseif $oop == 'info'}
					<div class="list-group center" style="width:95%;margin-left: 44px;padding-top: 25px">
						<p href="#" class="list-group-item active" style="height:55px;background-color: #D9EDF7;border:1px solid #D9EDF7;color:#31708F"><span >{$info['name']}设置报名入口</span><span><a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'city'))}" style="float: right" class="btn btn-success">返回城市列表</a></span></p>
						<div active="list-group-item " style="border:1px solid #cecece">
							<form action="" method="post" class="form-horizontal" >
								<input type="hidden" name="cityid" value="{$info['id']}">
								<div class="form-group" style="margin-top:25px">
									<label  class="col-sm-2 control-label">城市名称</label>
									<div class="col-sm-10">
										<input type="text" name="name" value="{$info['name']}"  class="form-control" style="width:98%" disabled/>
									</div>
								</div>
								<div class="form-group" style="margin-top:25px">
									<label class="col-sm-2 control-label">地址</label>
									<div class="col-sm-10">
										<input type="text" name="address" value="{$info['address']}"  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group" style="margin-top:25px">
									<label class="col-sm-2 control-label">联系方式</label>
									<div class="col-sm-10">
										<input type="text" name="tel" value="{$info['tel']}"  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group" style="margin-top:25px">
									<label class="col-sm-2 control-label">QQ</label>
									<div class="col-sm-10">
										<input type="number" name="qq" value="{$info['qq']}"  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group" style="margin-top:25px">
									<label  class="col-sm-2 control-label">二维码</label>
									<div class="col-sm-10" style="width:82%">
										{php echo tpl_form_field_image('image',$info['image'])}
									</div>
								</div>
								<div class="form-group" >
									<label  class="col-sm-2 control-label">详细描述</label>
									<div class="col-sm-10" style="width:82%">
										{php echo tpl_ueditor('description',$info['description'])}
									</div>
								</div>

								<input type="hidden" name="token" value="{$_W['token']}">
								<div style="float: right;margin:10px">
									<input type="submit" name="submit" value="保存设置" class="btn btn-info" >
								</div>
								<div style="clear: both;"></div>
							</form>
						</div>
					</div>

				{/if}
			</div>
{elseif $type == 'class'}
	<div class="tab-content" style="border:1px solid #cecece;border-top: 0">
		<a href="#addclass" role="button" class="btn btn-success" data-toggle="modal" style="float:right;margin: 15px"><span onclick="clear11()">添加年级</span></a>
			<table class="table table-bordered table-hover"  style="width:98%" align="center">
	            <thead>
	              <tr >
					  <th>
						  {if $paixu == 2}
						  <a href="{php echo $this->createWebUrl('index',['op'=>'setting','type'=>'class','oop'=>'list','paixu'=>1])}">
							  排序 <img src="{php echo MODULE_URL.'images/up.png'}" alt="" style="height: 14px;">
						  </a>
						  {elseif $paixu == 1}
						  <a href="{php echo $this->createWebUrl('index',['op'=>'setting','type'=>'class','oop'=>'list','paixu'=>2])}">
							  排序 <img src="{php echo MODULE_URL.'images/down.png'}" alt="" style="height: 14px;">
						  </a>
						  {/if}
					  </th>
	                <th>年级名称</th>
	                <th>年级ID</th>
	                <!--<th>排序</th>-->

	                <th>状态</th>
	                <th>操作</th>
	              </tr>
	            </thead>
	            <tbody>
	              {loop $classlist $row}
	              <tr>
					  <td class="cpaixu" id="{$row['id']}" onclick="order(this)">{$row['order']}</td>
	                <td>{$row['name']}</td>
	                <td>{$row['id']}</td>
	                <td style="width:15%"><div class="btn {if $row['status'] == 0}btn-danger{else}btn-info{/if}" data="{$row['id']}" onclick="classstatus(this)">{if $row['status'] == 0}不显示{elseif $row['status'] == 1}显示{/if}</div></td>
					  <td>
						  <a href="#addclass " data-toggle="modal" onclick="edit({$row['id']})" class="btn btn-primary">编辑</a>
						  <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'class','oop'=>'delete','classid'=>$row['id']))}" class="btn btn-danger">删除</a>
					  </td>
	              </tr>
	              {/loop}
	            </tbody>
	          </table>
	          <script type="text/javascript">
	          	function classstatus(obj){
	          		var obj = $(obj);
	          		var id = obj.attr('data');
	          		if(obj.hasClass('btn-danger')){
	          			var sta = 1;
	          		}else{
	          			var sta = 0;
	          		}
	          		$.ajax({
	          			type:'post',
	          			url:"{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'class','oop'=>'changestatus'))}",
	          			data:{id:id,sta:sta},
	          			success:function(res){
	          				var res = JSON.parse(res);
	          				if(res.success == 1){
	          					if(sta == 1){
	          						obj.removeClass('btn-danger');
	          						obj.addClass('btn-info');
	          						obj.html('显示');
	          					}else{
	          						obj.removeClass('btn-info');
	          						obj.addClass('btn-danger');
	          						obj.html('不显示');
	          					}
	          				}else{
	          					alert(res.mess);
	          				}
	          			}
	          		});
	          	}
				$(function(){
					$('.cpaixu').click(function(){
						if(!$(this).is('.input')){
							$(this).addClass('input').html('<input type="text" id="'+$(this).attr("id") +'" style="width: 50px;" value="'+ $(this).text() +'" />').find('input').focus().blur(function(){
								var order=$(this).val();
								var id=$(this).attr("id");
								$.ajax({
									type: 'POST',
									url: "{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'class','oop'=>'sort'))}",
									data: {classid:id,order:order},
									success:function(res){
										var res = JSON.parse(res);
										location.reload();
									}
								});
								$(this).parent().removeClass('input').html($(this).val() || 0);
							});
						}
					}).hover(function(){
						$(this).addClass('hover');
					},function(){
						$(this).removeClass('hover');
					});
				});
	          </script>
	          <div class="modal fade" id="addclass" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<form action="./index.php" method="post">
							<input type="hidden" name="c" value="site">
		  					<input type="hidden" name="a" value="entry">
		  					<input type="hidden" name="m" value="goouc_class">
		  					<input type="hidden" name="do" value="index">
		  					<input type="hidden" name="op" value="setting">
		  					<input type="hidden" name="type" value="class">
		  					<input type="hidden" name="oop" value="add">
		  					<input type="hidden" name="classid" id="clid" value="">
						<div class="modal-content">
							<div class="modal-header">
								 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
								<h4 class="modal-title" id="class">
									添加年级
								</h4>
							</div>
							<div class="modal-body">
								<div class="form-group">
									<label  class="col-sm-2 control-label">年级名称</label>
									<div class="col-sm-10">
										<input type="text" name="name" id="clname" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group">
									<label  class="col-sm-2 control-label">排序</label>
									<div class="col-sm-10">
										<input type="number" name="order" id="clorder" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>

								<div class="form-group">
									<label  class="col-sm-2 control-label">选择学科</label>
									<div class=" col-sm-10">
									{loop $subjectlist $roww}
									<label class="checkbox-inline checked" >
										<input type="checkbox" name="subjectid[]" value="{$roww['id']}" > {$roww['name']}
									</label>
									{/loop}
									</div>
								</div>
								<div class="form-group">
									<label  class="col-sm-2 control-label">学龄</label>
									<div class=" col-sm-10">
										<select name="classyear" class="checkbox-inline checked">
											<option  value="1" > --小学--</option>
											<option  value="2" > --初中--</option>
											<option  value="3" > --其他--</option>
										</select>
									</div>
								</div>

								<div class="form-group ">
			                        <label  class="col-sm-2 control-label">年级状态</label>
			                        <div class=" col-sm-10" style="padding-left:25px">
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status0" value="0" checked="checked" title="不显示"> 不显示
			                          </label>
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status1" value="1" title="显示" > 显示
			                          </label>
			                        </div>
			                        <span style='color: #cecece;font-size: 14px;margin-left: 16px'>若不选择，默认为不显示</span>
			                	</div>

							</div>
							<input type="hidden" name="token" value="{$_W['token']}">
							<div class="modal-footer">
								 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								 <input type="submit" name="submit" value="保存" class="btn btn-info">
							</div>
						</div>
						</form>
					</div>
				</div>
				<script type="text/javascript">
					function clear11(){
						$('#clname')[0].value = '';
						$('#clorder')[0].value = 0;
						$('#status0')[0].checked = true;
						$('#status1')[0].checked = false;
                        $('#class').html('添加年级');
						for(var i = 0;i< $('.checked input[type="checkbox"]').length;i++){
							$('.checked input[type="checkbox"]')[i].checked = false;
						}
					}
					function edit(classid){
						var classid = classid;
						var clname = $('#clname');
						var clorder = $('#clorder');
						var status0 = $('#status0');
						var status1 = $('#status1');
						var clid = $('#clid');
						status0.prop('checked','false');
						status1.prop('checked','false');

						$.get(
							'./index.php?c=site&a=entry&m=goouc_class&do=index&op=setting&type=class&oop=add',
							{classid:classid},
							function(res){
								clname.val(res.name);
								clorder.val(res.order);
								clid.val(res.id);
								$('#class').html('修改年级信息');
								for(var i=0;i< $('.checked input[type="checkbox"]').length;i++){
										$('.checked input[type="checkbox"]')[i].checked = false;
									for(var j = 0;j<res.subjectid.length;j++){
										if($('.checked input[type="checkbox"]')[i].value == res.subjectid[j]){
											$('.checked input[type="checkbox"]')[i].checked = true;
										}
									}
								}
								for(var i=0;i<$('option').length;i++){
									if($('option')[i].value == res.classyear){

										$('option')[i].selected = true;
									}
								}
								if(res.status == 0){
									status0.prop('checked','true');
								}
								if(res.status == 1){
									status1.prop('checked','true');
								}
							},"JSON");

					}
				</script>
			</div>
{elseif $type == 'subject'}
	<div class="tab-content" style="border:1px solid #cecece;border-top: 0">
		<a href="#addsubject" role="button" class="btn btn-success" data-toggle="modal" style="float:right;margin: 15px"><span onclick="clear11()">添加学科</span></a>
			<table class="table table-bordered table-hover"  style="width:98%" align="center">
	            <thead>
	              <tr >
					  <th>
						  {if $paixu == 2}
						  <a href="{php echo $this->createWebUrl('index',['op'=>'setting','type'=>'subject','oop'=>'list','paixu'=>1])}">
							  排序 <img src="{php echo MODULE_URL.'images/up.png'}" alt="" style="height: 14px;">
						  </a>
						  {elseif $paixu == 1}
						  <a href="{php echo $this->createWebUrl('index',['op'=>'setting','type'=>'subject','oop'=>'list','paixu'=>2])}">
							  排序 <img src="{php echo MODULE_URL.'images/down.png'}" alt="" style="height: 14px;">
						  </a>
						  {/if}
					  </th>
	                <th>学科名称</th>
	                <th>学科ID</th>
	                <th>状态</th>
	                <th>操作</th>
	              </tr>
	            </thead>
	            <tbody>
	              {loop $subjectlist $row}
	              <tr>
					  <td class="spaixu" id="{$row['id']}" onclick="order(this)">{$row['order']}</td>
	                <td>{$row['name']}</td>
	                <td>{$row['id']}</td>

	                <td style="width:15%"><div class="btn {if $row['status'] == 0}btn-danger{else}btn-info{/if}" data="{$row['id']}" onclick="subjectstatus(this)">{if $row['status'] == 0}不显示{elseif $row['status'] == 1}显示{/if}</div></td>
	                <!--<td>
	                  <div class="btn-group">
	                     <button class="btn btn-default" disabled>操作</button>
	                     <button data-toggle="dropdown" class="btn btn-default dropdown-toggle"><span class="caret"></span></button>
	                    <ul class="dropdown-menu">
	                      <li>
	                        <a href="#addsubject " data-toggle="modal" onclick="edit({$row['id']})">
	                        	编辑
	                        </a>
	                      </li>
	                      <li >
	                         <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'subject','oop'=>'delete','subjectid'=>$row['id']))}">删除</a>
	                      </li>
	                    </ul>
	                  </div>
	                </td>-->
					  <td>
						  <a href="#addsubject " data-toggle="modal" onclick="edit({$row['id']})" class="btn btn-primary">编辑</a>
						  <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'subject','oop'=>'delete','subjectid'=>$row['id']))}" class="btn btn-danger">删除</a>
					  </td>
	              </tr>
	              {/loop}
	            </tbody>
	          </table>
	          <script type="text/javascript">
	          	function subjectstatus(obj){
	          		var obj = $(obj);
	          		var id = obj.attr('data');
	          		if(obj.hasClass('btn-danger')){
	          			var sta = 1;
	          		}else{
	          			var sta = 0;
	          		}
	          		$.ajax({
	          			type:'post',
	          			url:"{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'subject','oop'=>'changestatus'))}",
	          			data:{id:id,sta:sta},
	          			success:function(res){
	          				var res = JSON.parse(res);
	          				if(res.success == 1){
	          					if(sta == 1){
	          						obj.removeClass('btn-danger');
	          						obj.addClass('btn-info');
	          						obj.html('显示');
	          					}else{
	          						obj.removeClass('btn-info');
	          						obj.addClass('btn-danger');
	          						obj.html('不显示');
	          					}
	          				}else{
	          					alert(res.mess);
	          				}
	          			}
	          		});
	          	}
				$(function(){
					$('.spaixu').click(function(){
						if(!$(this).is('.input')){
							$(this).addClass('input').html('<input type="text" id="'+$(this).attr("id") +'" style="width: 50px;" value="'+ $(this).text() +'" />').find('input').focus().blur(function(){
								var order=$(this).val();
								var id=$(this).attr("id");
								$.ajax({
									type: 'POST',
									url: "{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'subject','oop'=>'sort'))}",
									data: {subjectid:id,order:order},
									success:function(res){
										var res = JSON.parse(res);
										location.reload();
									}
								});
								$(this).parent().removeClass('input').html($(this).val() || 0);
							});
						}
					}).hover(function(){
						$(this).addClass('hover');
					},function(){
						$(this).removeClass('hover');
					});
				});
	          </script>
	          <div class="modal fade" id="addsubject" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<form action="./index.php" method="post">
							<input type="hidden" name="c" value="site">
		  					<input type="hidden" name="a" value="entry">
		  					<input type="hidden" name="m" value="goouc_class">
		  					<input type="hidden" name="do" value="index">
		  					<input type="hidden" name="op" value="setting">
		  					<input type="hidden" name="type" value="subject">
		  					<input type="hidden" name="oop" value="add">
		  					<input type="hidden" name="subjectid" id="sid" value="">
						<div class="modal-content">
							<div class="modal-header">
								 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
								<h4 class="modal-title" id="subject">
									添加学科
								</h4>
							</div>
							<div class="modal-body">
								<div class="form-group">
									<label  class="col-sm-2 control-label">学科名称</label>
									<div class="col-sm-10">
										<input type="text" name="name" id="sname" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group">
									<label  class="col-sm-2 control-label">排序</label>
									<div class="col-sm-10">
										<input type="number" name="order" id="sorder" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group ">
			                        <label class="col-sm-2 control-label">学科状态</label>
			                        <div class=" col-sm-10" style="padding-left:25px">
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status0" value="0" checked="checked" title="不显示"> 不显示
			                          </label>
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status1" value="1" title="显示" > 显示
			                          </label>
			                        </div>
			                        <span style='color: #cecece;font-size: 14px;margin-left: 16px'>若不选择，默认为不显示</span>
			                </div>
							</div>
							<input type="hidden" name="token" value="{$_W['token']}">
							<div class="modal-footer">
								 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								 <input type="submit" name="submit" value="保存" class="btn btn-info">
							</div>
						</div>
						</form>
					</div>
				</div>
				<script type="text/javascript">

					function clear11(){

						$('#sname')[0].value = '';
						$('#sorder')[0].value = 0;
						$('#status0')[0].checked = true;
						$('#status1')[0].checked = false;
                        $('#subject').html('添加学科');
					}
					function edit(subjectid){
						var subjectid = subjectid;
						var sname = $('#sname');
						var sorder = $('#sorder');
						var status0 = $('#status0');
						var status1 = $('#status1');
						var sid = $('#sid');
						status0.prop('checked','false');
						status1.prop('checked','false');
						$.get(
							'./index.php?c=site&a=entry&m=goouc_class&do=index&op=setting&type=subject&oop=add',
							{subjectid:subjectid},
							function(res){
								console.log(res);
								sname.val(res.name);
								sorder.val(res.order);
								sid.val(res.id);
								$('#subject').html('修改学科信息');
								if(res.status == 0){
									status0.prop('checked','true');
								}
								if(res.status == 1){
									status1.prop('checked','true');
								}
							},"JSON"
							);

					}
				</script>
			</div>
{elseif $type == 'classtype'}
	<div class="tab-content" style="border:1px solid #cecece;border-top: 0">
			<a href="#addclasstype" role="button" class="btn btn-success" data-toggle="modal" style="float:right;margin: 15px"><span onclick="clear11()">添加班型</span></a>
			<table class="table table-bordered table-hover"  style="width:98%" align="center">
				<thead>
				<tr >
					<th>
						{if $paixu == 2}
						<a href="{php echo $this->createWebUrl('index',['op'=>'setting','type'=>'classtype','oop'=>'list','paixu'=>1])}">
							排序 <img src="{php echo MODULE_URL.'images/up.png'}" alt="" style="height: 14px;">
						</a>
						{elseif $paixu == 1}
						<a href="{php echo $this->createWebUrl('index',['op'=>'setting','type'=>'classtype','oop'=>'list','paixu'=>2])}">
							排序 <img src="{php echo MODULE_URL.'images/down.png'}" alt="" style="height: 14px;">
						</a>
						{/if}
					</th>
					<th>班型名称</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
				</thead>
				<tbody>
				{loop $classtypelist $row}
				<tr>
					<td class="ctpaixu" id="{$row['id']}">{$row['order']}</td>
					<td>{$row['name']}</td>

					<td style="width:15%"><div class="btn {if $row['status'] == 0}btn-danger{else}btn-info{/if}" data="{$row['id']}" onclick="classtypestatus(this)">{if $row['status'] == 0}不显示{elseif $row['status'] == 1}显示{/if}</div></td>
					<!--<td>
						<div class="btn-group">
							<button class="btn btn-default" disabled>操作</button>
							<button data-toggle="dropdown" class="btn btn-default dropdown-toggle"><span class="caret"></span></button>
							<ul class="dropdown-menu">
								<li>
									<a href="#addclasstype" data-toggle="modal" onclick="edit({$row['id']})">编辑</a>
								</li>
								<li >
									<a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'classtype','oop'=>'delete','classtypeid'=>$row['id']))}">删除</a>
								</li>
							</ul>
						</div>
					</td>-->
					<td>
						<a href="#addclasstype " data-toggle="modal" onclick="edit({$row['id']})" class="btn btn-primary">编辑</a>
						<a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'classtype','oop'=>'delete','classtypeid'=>$row['id']))}" class="btn btn-danger">删除</a>
					</td>
				</tr>
				{/loop}
				</tbody>
			</table>
			<script type="text/javascript">
                function classtypestatus(obj){
                    var obj = $(obj);
                    var id = obj.attr('data');
                    if(obj.hasClass('btn-danger')){
                        var sta = 1;
                    }else{
                        var sta = 0;
                    }
                    $.ajax({
                        type:'post',
                        url:"{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'classtype','oop'=>'changestatus'))}",
                        data:{id:id,sta:sta},
                        success:function(res){
                            var res = JSON.parse(res);
                            if(res.success == 1){
                                if(sta == 1){
                                    obj.removeClass('btn-danger');
                                    obj.addClass('btn-info');
                                    obj.html('显示');
                                }else{
                                    obj.removeClass('btn-info');
                                    obj.addClass('btn-danger');
                                    obj.html('不显示');
                                }
                            }else{
                                alert(res.mess);
                            }
                        }
                    });
                }
				$(function(){
					$('.ctpaixu').click(function(){
						if(!$(this).is('.input')){
							$(this).addClass('input').html('<input type="text" id="'+$(this).attr("id") +'" style="width: 50px;" value="'+ $(this).text() +'" />').find('input').focus().blur(function(){
								var order=$(this).val();
								var id=$(this).attr("id");
								$.ajax({
									type: 'POST',
									url: "{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'classtype','oop'=>'sort'))}",
									data: {classtypeid:id,order:order},
									success:function(res){
										var res = JSON.parse(res);
										location.reload();
									}
								});
								$(this).parent().removeClass('input').html($(this).val() || 0);
							});
						}
					}).hover(function(){
						$(this).addClass('hover');
					},function(){
						$(this).removeClass('hover');
					});
				});
			</script>
			<div class="modal fade" id="addclasstype" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<form action="./index.php" method="post">
						<input type="hidden" name="c" value="site">
						<input type="hidden" name="a" value="entry">
						<input type="hidden" name="m" value="goouc_class">
						<input type="hidden" name="do" value="index">
						<input type="hidden" name="op" value="setting">
						<input type="hidden" name="type" value="classtype">
						<input type="hidden" name="oop" value="add">
						<input type="hidden" name="classtypeid" id="classtypeid" value="">
						<div class="modal-content">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
								<h4 class="modal-title" id="classtype">
									添加班型
								</h4>
							</div>
							<div class="modal-body">
								<div class="form-group">
									<label  class="col-sm-2 control-label">班型名称</label>
									<div class="col-sm-10">
										<input type="text" name="name" id="classtypename" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group">
									<label  class="col-sm-2 control-label">排序</label>
									<div class="col-sm-10">
										<input type="number" name="order" id="classtypeorder" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group ">
									<label  class="col-sm-2 control-label">班型状态</label>
									<div class=" col-sm-10" style="padding-left:25px">
										<label class="radio-inline">
											<input type="radio" name="status" id="status0" value="0" checked="checked" title="不显示"> 不显示
										</label>
										<label class="radio-inline">
											<input type="radio" name="status" id="status1" value="1" title="显示" > 显示
										</label>
									</div>
									<span style='color: #cecece;font-size: 14px;margin-left: 16px'>若不选择，默认为不显示</span>
								</div>
							</div>
							<input type="hidden" name="token" value="{$_W['token']}">
							<div class="modal-footer">
								<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								<input type="submit" name="submit" value="保存" class="btn btn-info">
							</div>
						</div>
					</form>
				</div>
			</div>
			<script type="text/javascript">
                function clear11(){
                    $('#classtypename')[0].value = '';
                    $('#classtypeorder')[0].value = 0;
                    $('#status0')[0].checked = true;
                    $('#status1')[0].checked = false;
                    $('#classtype').html('添加班型');
                    for(var i = 0;i< $('.checked input[type="checkbox"]').length;i++){
                        $('.checked input[type="checkbox"]')[i].checked = false;
                    }
                }
                function edit(cltypeid){
                    var cltypeid = cltypeid;
                    var classtypename = $('#classtypename');
                    var classtypeorder = $('#classtypeorder');
                    var status0 = $('#status0');
                    var status1 = $('#status1');
                    var classtypeid = $('#classtypeid');
                    status0.prop('checked','false');
                    status1.prop('checked','false');

                    $.get(
                        './index.php?c=site&a=entry&m=goouc_class&do=index&op=setting&type=classtype&oop=add',
                        {classtypeid:cltypeid},
                        function(res){
                            console.log(res);
                            classtypename.val(res.name);
                            classtypeorder.val(res.order);
                            classtypeid.val(res.id);
                            $('#classtype').html('修改班型信息');
                            for(var i=0;i< $('.checked input[type="checkbox"]').length;i++){
                                $('.checked input[type="checkbox"]')[i].checked = false;
                                for(var j = 0;j<res.subjectid.length;j++){
                                    if($('.checked input[type="checkbox"]')[i].value == res.subjectid[j]){
                                        $('.checked input[type="checkbox"]')[i].checked = true;
                                    }
                                }
                            }
                            for(var i=0;i<$('option').length;i++){
                                if($('option')[i].value == res.classyear){

                                    $('option')[i].selected = true;
                                }
                            }
                            if(res.status == 0){
                                status0.prop('checked','true');
                            }
                            if(res.status == 1){
                                status1.prop('checked','true');
                            }
                        },"JSON");

                }
			</script>
	</div>
{elseif $type == 'semester'}
	<div class="tab-content" style="border:1px solid #cecece;border-top: 0">
		<a href="#addsemester" role="button" class="btn btn-success" data-toggle="modal" style="float:right;margin: 15px"><span onclick="clear11()">添加学期</span></a>
			<table class="table table-bordered table-hover"  style="width:98%" align="center">
	            <thead>
	              <tr >
	                <th>学期名称</th>
	                <th>学期ID</th>
	                <th>状态</th>
	                <th>操作</th>
	              </tr>
	            </thead>
	            <tbody>
	              {loop $semesterlist $row}
	              <tr>
	                <td>{$row['name']}</td>
	                <td>{$row['id']}</td>
	                <td style="width:15%"><div class="btn {if $row['status'] == 0}btn-danger{else}btn-info{/if}" data="{$row['id']}" onclick="semesterstatus(this)">{if $row['status'] == 0}不显示{elseif $row['status'] == 1}显示{/if}</div></td>
					  <td>
						  <a href="#addsemester " data-toggle="modal" onclick="edit({$row['id']})" class="btn btn-primary">编辑</a>
						  <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'semester','oop'=>'delete','semesterid'=>$row['id']))}" class="btn btn-danger">删除</a>
					  </td>
	              </tr>
	              {/loop}
	            </tbody>
	          </table>
	          <script type="text/javascript">
	          	function semesterstatus(obj){
	          		var obj = $(obj);
	          		var id = obj.attr('data');
	          		if(obj.hasClass('btn-danger')){
	          			var sta = 1;
	          		}else{
	          			var sta = 0;
	          		}
	          		$.ajax({
	          			type:'post',
	          			url:"{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'semester','oop'=>'changestatus'))}",
	          			data:{id:id,sta:sta},
	          			success:function(res){
	          				var res = JSON.parse(res);
	          				if(res.success == 1){
	          					if(sta == 1){
	          						obj.removeClass('btn-danger');
	          						obj.addClass('btn-info');
	          						obj.html('显示');
	          					}else{
	          						obj.removeClass('btn-info');
	          						obj.addClass('btn-danger');
	          						obj.html('不显示');
	          					}
	          				}else{
	          					alert(res.mess);
	          				}
	          			}
	          		});
	          	}
	          </script>

	          <div class="modal fade" id="addsemester" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<form action="./index.php" method="post">
							<input type="hidden" name="c" value="site">
		  					<input type="hidden" name="a" value="entry">
		  					<input type="hidden" name="m" value="goouc_class">
		  					<input type="hidden" name="do" value="index">
		  					<input type="hidden" name="op" value="setting">
		  					<input type="hidden" name="type" value="semester">
		  					<input type="hidden" name="oop" value="add">
		  					<input type="hidden" name="semesterid" id="sid" value="">
						<div class="modal-content">
							<div class="modal-header">
								 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
								<h4 class="modal-title" id="semester">
									添加学期
								</h4>
							</div>
							<div class="modal-body">
								<div class="form-group">
									<label  class="col-sm-2 control-label">学期</label>
									<div class="col-sm-10">
										<input type="text" name="name" id="sname" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group ">
			                        <label  class="col-sm-2 control-label">学期状态</label>
			                        <div class=" col-sm-10" style="padding-left:25px">
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status0" value="0" checked="checked" title="不显示"> 不显示
			                          </label>
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status1" value="1" title="显示" > 显示
			                          </label>
			                        </div>
			                        <span style='color: #cecece;font-size: 14px;margin-left: 16px'>若不选择，默认为不显示</span>
			                </div>
							</div>
							<input type="hidden" name="token" value="{$_W['token']}">
							<div class="modal-footer">
								 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								 <input type="submit" name="submit" value="保存" class="btn btn-info">
							</div>
						</div>
						</form>
					</div>
				</div>
				<script type="text/javascript">
					function clear11(){
						// console.log($('#cityname')[0].value);
						$('#sname')[0].value = '';
						$('#status0')[0].checked = true;
						$('#status1')[0].checked = false;
                        $('#semester').html('添加班期');
					}
					function edit(semesterid){
						var semesterid = semesterid;
						var sname = $('#sname');
						var status0 = $('#status0');
						var status1 = $('#status1');
						var sid = $('#sid');
						status0.prop('checked','false');
						status1.prop('checked','false');
						$.get(
							'./index.php?c=site&a=entry&m=goouc_class&do=index&op=setting&type=semester&oop=add',
							{semesterid:semesterid},
							function(res){
								sname.val(res.name);
								sid.val(res.id);
								$('#semester').html('修改班期信息');
								if(res.status == 0){
									status0.prop('checked','true');
								}
								if(res.status == 1){
									status1.prop('checked','true');
								}
							},"JSON"
							);
					}
				</script>
			</div>
{elseif $type == 'voidtype'}
	<div class="tab-content" style="border:1px solid #cecece;border-top: 0">

		<a href="#addvoidtype" role="button" class="btn btn-success" data-toggle="modal" style="float:right;margin: 15px"><span onclick="clear11()">添加类型</span></a>
			<table class="table table-bordered table-hover"  style="width:98%" align="center">
	            <thead>
	              <tr >
	                <th>类型名称</th>
	                <th>类型ID</th>
	                <th>状态</th>
	                <th>操作</th>
	              </tr>
	            </thead>
	            <tbody>
	              {loop $voidtypelist $row}
	              <tr>
	                <td>{$row['name']}</td>
	                <td>{$row['id']}</td>
	                <td style="width:15%"><div class="btn {if $row['status'] == 0}btn-danger{else}btn-info{/if}" data="{$row['id']}" onclick="voidtypestatus(this)">{if $row['status'] == 0}不显示{elseif $row['status'] == 1}显示{/if}</div></td>
					  <td>
						  <a href="#addvoidtype " data-toggle="modal" onclick="edit({$row['id']})" class="btn btn-primary">编辑</a>
						  <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'voidtype','oop'=>'delete','voidtypeid'=>$row['id']))}" class="btn btn-danger">删除</a>
					  </td>
	              </tr>
	              {/loop}
	            </tbody>
	          </table>
	          <script type="text/javascript">
	          	function voidtypestatus(obj){
	          		var obj = $(obj);
	          		var id = obj.attr('data');
	          		if(obj.hasClass('btn-danger')){
	          			var sta = 1;
	          		}else{
	          			var sta = 0;
	          		}
	          		$.ajax({
	          			type:'post',
	          			url:"{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'voidtype','oop'=>'changestatus'))}",
	          			data:{id:id,sta:sta},
	          			success:function(res){
	          				var res = JSON.parse(res);
	          				if(res.success == 1){
	          					if(sta == 1){
	          						obj.removeClass('btn-danger');
	          						obj.addClass('btn-info');
	          						obj.html('显示');
	          					}else{
	          						obj.removeClass('btn-info');
	          						obj.addClass('btn-danger');
	          						obj.html('不显示');
	          					}
	          				}else{
	          					alert(res.mess);
	          				}
	          			}
	          		});
	          	}
	          </script>

	          <div class="modal fade" id="addvoidtype" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<form action="./index.php" method="post">
							<input type="hidden" name="c" value="site">
		  					<input type="hidden" name="a" value="entry">
		  					<input type="hidden" name="m" value="goouc_class">
		  					<input type="hidden" name="do" value="index">
		  					<input type="hidden" name="op" value="setting">
		  					<input type="hidden" name="type" value="voidtype">
		  					<input type="hidden" name="oop" value="add">
		  					<input type="hidden" name="voidtypeid" id="vid" value="">
						<div class="modal-content">
							<div class="modal-header">
								 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
								<h4 class="modal-title" id="voidtype">
									添加类型
								</h4>
							</div>
							<div class="modal-body">
								<div class="form-group">
									<label  class="col-sm-2 control-label">类型</label>
									<div class="col-sm-10">
										<input type="text" name="name" id="vname" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group ">
			                        <label  class="col-sm-2 control-label">类型状态</label>
			                        <div class=" col-sm-10" style="padding-left:25px">
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status0" value="0" checked="checked" title="不显示"> 不显示
			                          </label>
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status1" value="1" title="显示" > 显示
			                          </label>
			                        </div>
			                        <span style='color: #cecece;font-size: 14px;margin-left: 16px'>若不选择，默认为不显示</span>
			                </div>
							</div>
							<input type="hidden" name="token" value="{$_W['token']}">
							<div class="modal-footer">
								 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								 <input type="submit" name="submit" value="保存" class="btn btn-info">
							</div>
						</div>
						</form>
					</div>
				</div>
				<script type="text/javascript">

					function clear11(){
						// console.log($('#cityname')[0].value);
						$('#vname')[0].value = '';
						$('#status0')[0].checked = true;
						$('#status1')[0].checked = false;
                        $('#voidtype').html('添加视频类型');
					}
					function edit(voidtypeid){
						var voidtypeid = voidtypeid;
						var vname = $('#vname');
						var status0 = $('#status0');
						var status1 = $('#status1');
						var vid = $('#vid');
						status0.prop('checked','false');
						status1.prop('checked','false');
						$.get(
							'./index.php?c=site&a=entry&m=goouc_class&do=index&op=setting&type=voidtype&oop=add',
							{voidtypeid:voidtypeid},
							function(res){
								console.log(res);
								vname.val(res.name);
								vid.val(res.id);
								$('#voidtype').html('修改视频类型');
								if(res.status == 0){
									status0.prop('checked','true');
								}
								if(res.status == 1){
									status1.prop('checked','true');
								}
							},"JSON"
							);
					}
				</script>
			</div>
{elseif $type == 'level'}
	<div class="tab-content" style="border:1px solid #cecece;border-top: 0">

		<a href="#addlevel" role="button" class="btn btn-success" data-toggle="modal" style="float:right;margin: 15px"><span onclick="clear11()">添加等级</span></a>
			<table class="table table-bordered table-hover"  style="width:98%" align="center">
	            <thead>
	              <tr >
	                <th>等级名称</th>
	                <th>所需观看时长</th>
	                <th>等级ID</th>
	                <th>状态</th>
	                <th>操作</th>
	              </tr>
	            </thead>
	            <tbody>
	              {loop $levellist $row}
	              <tr>
	                <td>{$row['name']}</td>
	                <td>{$row['time']}分钟</td>
	                <td>{$row['id']}</td>
	                <td style="width:15%"><div class="btn {if $row['status'] == 0}btn-danger{else}btn-info{/if}" data="{$row['id']}" onclick="leveltatus(this)">{if $row['status'] == 0}不显示{elseif $row['status'] == 1}显示{/if}</div></td>
	                <td>
	                  <div class="btn-group">
	                     <button class="btn btn-default" disabled>操作</button>
	                     <button data-toggle="dropdown" class="btn btn-default dropdown-toggle"><span class="caret"></span></button>
	                    <ul class="dropdown-menu">
	                      <li>
	                        <a href="#addlevel " data-toggle="modal" onclick="edit({$row['id']})">
	                        	编辑
	                        </a>
	                      </li>
	                      <li >
	                         <a href="{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'level','oop'=>'delete','levelid'=>$row['id']))}">删除</a>
	                      </li>
	                    </ul>
	                  </div>
	                </td>
	              </tr>
	              {/loop}
	            </tbody>
	          </table>
	          <script type="text/javascript">
	          	function leveltatus(obj){
	          		var obj = $(obj);
	          		var id = obj.attr('data');
	          		if(obj.hasClass('btn-danger')){
	          			var sta = 1;
	          		}else{
	          			var sta = 0;
	          		}
	          		$.ajax({
	          			type:'post',
	          			url:"{php echo $this->createWebUrl('index',array('op'=>'setting','type'=>'level','oop'=>'changestatus'))}",
	          			data:{id:id,sta:sta},
	          			success:function(res){
	          				var res = JSON.parse(res);
	          				if(res.success == 1){
	          					if(sta == 1){
	          						obj.removeClass('btn-danger');
	          						obj.addClass('btn-info');
	          						obj.html('显示');
	          					}else{
	          						obj.removeClass('btn-info');
	          						obj.addClass('btn-danger');
	          						obj.html('不显示');
	          					}
	          				}else{
	          					alert(res.mess);
	          				}
	          			}
	          		});
	          	}
	          </script>

	          <div class="modal fade" id="addlevel" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<form action="./index.php" method="post">
							<input type="hidden" name="c" value="site">
		  					<input type="hidden" name="a" value="entry">
		  					<input type="hidden" name="m" value="goouc_class">
		  					<input type="hidden" name="do" value="index">
		  					<input type="hidden" name="op" value="setting">
		  					<input type="hidden" name="type" value="level">
		  					<input type="hidden" name="oop" value="add">
		  					<input type="hidden" name="lvid" id="lvid" value="">
						<div class="modal-content">
							<div class="modal-header">
								 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
								<h4 class="modal-title" id="level">
									添加等级
								</h4>
							</div>
							<div class="modal-body">
								<div class="form-group">
									<label  class="col-sm-2 control-label">等级称号</label>
									<div class="col-sm-10">
										<input type="text" name="name" id="lvname" value=""  placeholder=""  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group">
									<label  class="col-sm-2 control-label">需要观看时间</label>
									<div class="col-sm-10">
										<input type="num" name="time" id="lvtime" value=""  placeholder="单位为分钟"  class="form-control" style="width:98%"/>
									</div>
								</div>
								<div class="form-group ">
			                        <label  class="col-sm-2 control-label">等级状态</label>
			                        <div class=" col-sm-10" style="padding-left:25px">
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status0" value="0" checked="checked" title="不显示"> 不显示
			                          </label>
			                          <label class="radio-inline">
			                            <input type="radio" name="status" id="status1" value="1" title="显示" > 显示
			                          </label>
			                        </div>
			                        <span style='color: #cecece;font-size: 14px;margin-left: 16px'>若不选择，默认为不显示</span>
			                </div>
							</div>
							<input type="hidden" name="token" value="{$_W['token']}">
							<div class="modal-footer">
								 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								 <input type="submit" name="submit" value="保存" class="btn btn-info">
							</div>
						</div>
						</form>
					</div>
				</div>
				<script type="text/javascript">

					function clear11(){
						// console.log($('#cityname')[0].value);
						$('#lvname')[0].value = '';
						$('#lvtime')[0].value = '';
						$('#status0')[0].checked = true;
						$('#status1')[0].checked = false;
                        $('#level').html('添加等级');
					}
					function edit(levelid){
						var levelid = levelid;
						var lvname = $('#lvname');
						var lvtime = $('#lvtime');
						var status0 = $('#status0');
						var status1 = $('#status1');
						var lvid = $('#lvid');
						status0.prop('checked','false');
						status1.prop('checked','false');
						$.get(
							'./index.php?c=site&a=entry&m=goouc_class&do=index&op=setting&type=level&oop=add',
							{lvid:levelid},
							function(res){
								console.log(res);
								lvname.val(res.name);
								lvtime.val(res.time);
								lvid.val(res.id);
								$('#level').html('修改等级类型');
								if(res.status == 0){
									status0.prop('checked','true');
								}
								if(res.status == 1){
									status1.prop('checked','true');
								}
							},"JSON"
							);
					}
				</script>
			</div>
{elseif $type == 'sharetitle'}
	<div class="tab-content" style="border:1px solid #cecece;border-top: 0">
				<form action="./index.php" method="post">
					<input type="hidden" name="c" value="site">
  					<input type="hidden" name="a" value="entry">
  					<input type="hidden" name="m" value="goouc_class">
  					<input type="hidden" name="do" value="index">
  					<input type="hidden" name="op" value="setting">
  					<input type="hidden" name="type" value="sharetitle">
				<div active="list-group-item" style="margin:0 auto">
					<div class="form-group" style="padding-left:15px;padding-top: 25px">
						<label  class="col-sm-2 control-label">首页标题</label>
						<div class="col-sm-10">
							<input type="text" name="selected" value="{$info['selected']}" placeholder="请填写标题"  class="form-control" style="width:98%"/>
						</div>
					</div>
					<div class="form-group" style="margin-top:25px;padding-left:15px">
						<label  class="col-sm-2 control-label">个人中心分享标题</label>
						<div class="col-sm-10">
							<input type="text" name="mine" value="{$info['mine']}" placeholder="请填写标题"  class="form-control" style="width:98%"/>
						</div>
					</div>
					<div class="form-group" style="margin-top:25px;padding-left:15px">
						<label  class="col-sm-2 control-label">排行榜分享标题</label>
						<div class="col-sm-10">
							<input type="text" name="ranking" value="{$info['ranking']}" placeholder="请填写标题"  class="form-control" style="width:98%"/>
						</div>
					</div>
					<!-- <div class="form-group" style="margin-top:25px;padding-left:15px">
						<label  class="col-sm-2 control-label">完善信息分享标题</label>
						<div class="col-sm-10">
							<input type="text" name="ranking_detail" value="{$info['ranking_detail']}" placeholder="请填写标题"  class="form-control" style="width:98%"/>
						</div>
					</div> -->
					<!-- <div class="form-group" style="margin-top:25px;padding-left:15px">
						<label  class="col-sm-2 control-label">签到分享标题</label>
						<div class="col-sm-10">
							<input type="text" name="myday" value="{$info['myday']}" placeholder="请填写标题"  class="form-control" style="width:98%"/>
						</div>
					</div> -->
					<!-- <div class="form-group" style="margin-top:25px;padding-left:15px">
						<label  class="col-sm-2 control-label">购买页面分享标题</label>
						<div class="col-sm-10">
							<input type="text" name="rechange" value="{$info['rechange']}" placeholder="请填写标题"  class="form-control" style="width:98%"/>
						</div>
					</div> -->
					<div class="form-group" style="margin-top:25px;padding-left:15px">
						<label  class="col-sm-2 control-label">咨询分享标题</label>
						<div class="col-sm-10">
							<input type="text" name="consultation" value="{$info['consultation']}" placeholder="请填写标题"  class="form-control" style="width:98%"/>
						</div>
					</div>
					<input type="hidden" name="token" value="{$_W['token']}">
					<div style="float: right;margin:10px">
						<input type="submit" name="submit" value="保存设置" class="btn btn-info" >
					</div>
					<div style="clear: both;"></div>
				</div>

				</form>
</div>
{/if}

	</div>
</div>

{/if}

{template "common/footer"}